import { Injectable } from '@angular/core';
import {StorageService} from "./storage.service";
import {HttpClient} from "@angular/common/http";
import {HostService} from "./host.service";

@Injectable({
  providedIn: 'root'
})
export class BlockchainService {

  public BlockHost = this.host.HOST+"/blockchain/"

  constructor(private host: HostService,
              private http: HttpClient
   ) {}

   private getChainCodeInfoURL = this.BlockHost+"member/getChainCodeInfo";
  getChainCodeInfo(){
    return this.http.get(this.getChainCodeInfoURL).toPromise()
  }
  private getHistoryByKeyForHistoryURL = this.BlockHost+"member/getHistoryByKeyForHistory";
  getHistoryByKeyForHistory(str:string){
    let parm ={
      "parm":str
    }
    return this.http.post(this.getHistoryByKeyForHistoryURL,parm).toPromise()
  }



}
